﻿@model ExpressQuiz.ViewModels.QuestionReviewViewModel


@section styles
{
    @Styles.Render("~/Content/font-awesome-4.2.0/css/font-awesome.min.css")
    @Styles.Render("~/Scripts/pagedown/css/jquery.pagedown-bootstrap.css")

}

@section scripts
{
    @Scripts.Render("~/Scripts/jquery.bootpag.min.js")
    @Scripts.Render("~/Scripts/pagedown/js/jquery.pagedown-bootstrap.combined.min.js")
}



<div class="text-center">
    <br />
    @Html.ActionLink("Back", "Index", new {id = @Model.QuizResultId}, new {@class = "btn btn-primary"})

</div>



    <div id="page-selection"></div>
    <div id="content">

        <h4>Question</h4>

        <div id="hiddenText" class="hidden">
            @Model.Question.Text
        </div>
        <div id="question" ></div>


        <h4>Answers</h4>
        <p>
            <div id="answers" class="col-lg-10">
                @{
                    foreach (var a in Model.Question.Answers)
                    {
                        <div class="radio">
                            <label>
                                @{


                                    <input type="radio"
                                        @(a.IsCorrect ? "checked" : "")
                                           name="optionsRadios" disabled />


                                    if (Model.UserAnswerId == a.AnswerId)
                                    {
                                        if (a.IsCorrect)
                                        {
                                            <div style="background: lightgreen">@a.Text</div>
                                        }
                                        else
                                        {
                                            <div style="background: lightcoral">@a.Text</div>
                                        }
                                    }
                                    else
                                    {
                                        <div>@a.Text</div>
                                    }
                                }
                            </label>
                        </div>
                        <div style="color: green">
                            @a.Explanation
                        </div>
                    }
                }
            </div>
        </p>

    </div>

    <br />





<br />





<script>


    $(document).ready(function() {

        var text = $("#hiddenText").text().trim();

        $("#question").empty();
        $("#question").append($("<textarea class='pagedown hidden' >" +
            text + "</textarea>"));

        $("textarea.pagedown").pagedownBootstrap({
            'sanatize': true
        });
        $('.wmd-preview').addClass('well');
        $(".wmd-button-bar").hide();

    });
</script>